package com.atguigu.szdz.dcsyl.service.impl;

import com.atguigu.szdz.dcsyl.utils.ApplicationContextProvider;
import com.atguigu.szdz.dcsyl.utils.MapperUtils;
import org.springframework.context.ApplicationContext;

import java.util.List;
import java.util.Map;

public class BaseServiceImpl {
    public List<Map<String, Object>> queryBySql(String sql) {
        ApplicationContext context = ApplicationContextProvider.getApplicationContext();
        MapperUtils mapperUtils = context.getBean(MapperUtils.class);
        return mapperUtils.queryBySql(sql);
    }

    public Integer updataBySql(String sql) {
        ApplicationContext context = ApplicationContextProvider.getApplicationContext();
        MapperUtils mapperUtils = context.getBean(MapperUtils.class);
        return mapperUtils.updataBySql(sql);
    }

}
